package com.sleep.satokendemo.listener;

import com.sleep.satokendemo.entry.DemoEvent;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RequiredArgsConstructor
public class DemoListener {

    private final LogService logService;
    @EventListener
    public void onEvent(DemoEvent event) {
        log.info("DemoListener.onEvent: " + event.getMessage());
        logService.doLog(event);
    }


}
